import Vue from 'vue'
import uView from "uview-ui";
import App from './App'

Vue.use(uView);

// 引入uView对小程序分享的mixin封装
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)

// 引入字符串处理组件
import _ from 'lodash';
Vue.prototype._ = _;

// 引入公共常量js
import C from '@/common/C';
Vue.prototype.C = C;

// 引入公共工具js
import UT from '@/common/UT';
Vue.prototype.U = UT;

// 引入公共表单验证js
import FV from '@/common/FV';
Vue.prototype.FV = FV;

// 注册全局过滤器
import filters from './common/filters/index.js';
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});
Vue.prototype.FT = filters;


Vue.config.productionTip = false;

App.mpType = 'app';

const app = new Vue({
    ...App
})


// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js';
Vue.use(httpInterceptor, app);

// http接口API集中管理引入部分
import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app)

app.$mount()
